package org.apache.jsp;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import com.asiainfo.ysrman.doprocess.*;
import com.asiainfo.ysrman.Beans.*;

public final class p_005fsetRing_jsp extends org.apache.jasper.runtime.HttpJspBase
    implements org.apache.jasper.runtime.JspSourceDependent {

  private static java.util.Vector _jspx_dependants;

  public java.util.List getDependants() {
    return _jspx_dependants;
  }

  public void _jspService(HttpServletRequest request, HttpServletResponse response)
        throws java.io.IOException, ServletException {

    JspFactory _jspxFactory = null;
    PageContext pageContext = null;
    HttpSession session = null;
    ServletContext application = null;
    ServletConfig config = null;
    JspWriter out = null;
    Object page = this;
    JspWriter _jspx_out = null;
    PageContext _jspx_page_context = null;


    try {
      _jspxFactory = JspFactory.getDefaultFactory();
      response.setContentType("text/html; charset=GBK");
      pageContext = _jspxFactory.getPageContext(this, request, response,
      			null, true, 8192, true);
      _jspx_page_context = pageContext;
      application = pageContext.getServletContext();
      config = pageContext.getServletConfig();
      session = pageContext.getSession();
      out = pageContext.getOut();
      _jspx_out = out;

      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
	
	int showFlag = 1;
	String via = "2";
	
	//if (session.getAttribute("mobile") == null||session.getAttribute("mobile").equals(""))
	//{	
		//response.sendRedirect("index.jsp");
	//	out.println("<script language=\"javaScript\">alert('请您先登陆再进行操作,谢谢!');</script>");
	//	return;
	//}
	//else
	//{
		YsrProcess uiProcess = new YsrProcess();	
		
		String mobile = "0";
		if ( request.getParameter("mobile") != null )
		{
			mobile = request.getParameter("mobile").toString();
		}
		//String mobile = session.getAttribute("mobile").toString();
		//via = session.getAttribute("muFlag").toString();
		
		if ( request.getParameter("via")!=null )
		{
			via = request.getParameter("via").toString();
		}
		String numStr =  request.getParameter("ringnum");
		//System.out.println("numstr="+numStr);
		
		int numid = 0;
		if (numStr != null && !numStr.equals(""))
			numid = Integer.parseInt(numStr);
		if ( numid != 0 && !mobile.equals("0"))
		{
			if (uiProcess.insertUserLog(mobile,numid,0,""))
			{
				showFlag = 1;	
			}
			else
				showFlag = 0;	
		}
		else
			showFlag = 0;	
		
	//}


      out.write("\r\n");
      out.write("<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n");
      out.write("<head>\r\n");
      out.write("<link href=\"styles/styles.css\" rel=\"stylesheet\" type=\"text/css\"/>\r\n");
      out.write("<script LANGUAGE=\"JavaScript\" SRC=\"script/score.js\" type=\"text/javascript\"></script>\r\n");
      out.write("<title>伊利优酸乳活动网站\r\n");
      out.write("</title>\r\n");
      out.write("</head>\r\n");
      out.write("<body>\r\n");
      out.write("<br>\r\n");
      out.write("\r\n");

	if (showFlag ==0) 
		out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;网络异常，请您稍后再试！");
	else{
		if (via.equals("2"))//china mobile
			out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FFFFFF'>您选择的歌曲已提交成功，如果您的手机开通彩铃服务，该彩铃下载后您会收到12530给您发的通知短信。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;感谢参与伊利优酸乳大学生音乐节活动!</font>");
		if (via.equals("0"))//china unicom
			out.println("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font color='#FFFFFF'>您选择的歌曲已提交成功，如果您的手机开通炫铃服务，该炫铃下载后您会收到10150给您发的通知短信。<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;感谢参与伊利优酸乳大学生音乐节活动!</font>");
	}

      out.write("\r\n");
      out.write("<br><br><center>\r\n");
      out.write("<input type=\"button\" class=\"btn01\" name=closebtn value=\"关  闭\" onclick=\"javascript:window.close();\">\r\n");
      out.write("</center>\r\n");
      out.write("</body>\r\n");
      out.write("</html>\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
      out.write("\r\n");
    } catch (Throwable t) {
      if (!(t instanceof SkipPageException)){
        out = _jspx_out;
        if (out != null && out.getBufferSize() != 0)
          out.clearBuffer();
        if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
      }
    } finally {
      if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
    }
  }
}
